<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2021/7/16
  Time: 15:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<a href="${pageContext.request.contextPath}/hero/addHero.jsp">添加英雄</a>
<table border="1">
    <thead>
    <th>编号</th>
    <th>英雄名</th>
    <th>分类</th>
    <th>血量</th>
    <th>攻击</th>
    <th>防御</th>
    <th>描述</th>
    <th>操作</th>
    </thead>
    <tbody>
    <c:forEach var="hero" items="${pageInfo.list}">
        <tr>
            <td>${hero.heroId}</td>
            <td>${hero.heroName}</td>
            <td>${hero.category}</td>
            <td>${hero.blood}</td>
            <td>${hero.atk}</td>
            <td>${hero.def}</td>
            <td>${hero.des}</td>
            <td><a href="${pageContext.request.contextPath}/removeHero.do?id=${hero.heroId}">删除</a>
                <a href="${pageContext.request.contextPath}/showOneHero.do?id=${hero.heroId}">更新</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<c:forEach var="i" begin="1" end="${pageInfo.pages}">
    <button ${pageNum == i}><a href="${pageContext.request.contextPath}/showAllHero.do?pageNum=${i}&pageSize=${pageSize}">${i}</a></button>
</c:forEach>
</body>
</html>
